Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to choose default split type #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

somini
Copy link

@somini somini commented Nov 8, 2015

This adds a new variable that can be set to influence the default split
method when using :Man. It also works on K.

The other commands Vman, etc are unaffected.

@bruno-
Copy link
Collaborator

bruno- commented Nov 9, 2015

Hey,
I find this option unusual. I don't think other popular plugins or built-in systems (like :help, :Explore, :Sexplore, :Vexplore) have something like this.

I think the right way for users to customize this is:

  • with a mapping
  • via command line abbreviation, example cab man Vman (I use this method, although a different abbreviation and it's just for the purpose of being faster, not changing split type)

@somini
Copy link
Author

somini commented Nov 10, 2015

Well, I like to use the man buffers like the help system, a unique command to reuse the same window. I put all the man buffers on the left with something like autocmd FileType man wincmd H, so that it's similar to NERDTree.
This is something to address two small issues:

  • No automatic width alignment, which leads to the wrong formatting (see Reformat text on window resize #14). If I open a manpage with Vman it works as intended.
  • With a cabbrev, the history gets littered with the other variants, so you can't easily write :Man and just get a list of the last opened man pages with the up arrow key.

The main issue is really #14, if that's solved then this PR is obsolete since you can just create an autocmd.

And now I really understand
Workflow

@somini
Copy link
Author

somini commented Nov 16, 2015

Rebased this into the latest master.

@bruno-
Copy link
Collaborator

bruno- commented Nov 16, 2015

Hi,
as mentioned in the previous comment I'm not the fan of this approach. In fact it's the first time I see it.
I'll let other users upvote this feature and if ppl like it then we'll merge.

@somini
Copy link
Author

somini commented Nov 17, 2015

Very well, no problem.

I just rebased this (and will probably continue to do so) to keep my branch updated, since I use it in my configuration. Don't take it as some kind of pressure to merge it.

This adds a new variable that can be set to influence the default split
method when using `:Man`.
The other commands `Vman`, etc are unaffected.
@lucc
Copy link

lucc commented Jan 13, 2016

I think this aproach is not uncommon. I use some plugins that do it like this. Bexec and CtrlP for example.
+1 from me.

(Not to forget the g:manpageview_winopen option in Dr. Chip's manpageview plugin)

njhoffman added a commit to njhoffman/vim-man that referenced this pull request Nov 20, 2021
@francozappa
Copy link

I agree with @lucc E.g., vim-tldr offers a similar option.

See: https://github.com/wlemuel/vim-tldr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants